import request from '@/utils/request'
export const getArtile = params => {
  return request({
    method: 'GET',
    url: '/v1_0/articles',
    params
  })
}
export const getArtileById = id => {
  return request({
    method: 'GET',
    url: '/v1_0/articles/' + id
  })
}
export const addCollect = target => {
  return request({
    method: 'POST',
    url: '/v1_0/article/collections',
    data: {
      target
    }
  })
}
export const delCollect = target => {
  return request({
    method: 'DELETE',
    url: `/v1_0/article/collections/${target}`
  })
}
export const addLike = target => {
  return request({
    method: 'POST',
    url: '/v1_0/article/likings',
    data: {
      target
    }
  })
}
export const delLike = target => {
  return request({
    method: 'DELETE',
    url: `/v1_0/article/likings/${target}`
  })
}
